package com.unionpay.mpds.model;

// default package

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * UIOper entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "T_UIOPER", uniqueConstraints = @UniqueConstraint(columnNames = "OPER_ID"))
public class UIOper implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = -8226099463470417920L;
	private String operId;
	private String operName;
	private String operPasswd;
	private String operStatus;
	private String operFlag;
	private String operOrgNo;
	private String operUtime;
	private String operItime;
	private String operEmail;
	private String operFax;
	private String operTel;
	private String roleName;
	private Role role;
	private String operOrgName;

	// Constructors

	/** default constructor */
	public UIOper() {
	}

	/** minimal constructor */
	public UIOper(String operId, String operName, String operPasswd,
			String operStatus, String operFlag, String operOrgNo,
			String operEmail, String operTel, String roleName, Role role,
			String operOrgName) {
		this.operId = operId;
		this.operName = operName;
		this.operPasswd = operPasswd;
		this.operStatus = operStatus;
		this.operFlag = operFlag;
		this.operOrgNo = operOrgNo;
		this.operEmail = operEmail;
		this.operTel = operTel;
		this.roleName = roleName;
		this.role = role;
		this.operOrgName = operOrgName;
	}

	/** full constructor */
	public UIOper(String operId, String operName, String operPasswd,
			String operStatus, String operFlag, String operOrgNo,
			String operUtime, String operItime, String operEmail,
			String operFax, String operTel, String roleName, Role role,
			String operOrgName) {
		this.operId = operId;
		this.operName = operName;
		this.operPasswd = operPasswd;
		this.operStatus = operStatus;
		this.operFlag = operFlag;
		this.operOrgNo = operOrgNo;
		this.operUtime = operUtime;
		this.operItime = operItime;
		this.operEmail = operEmail;
		this.operFax = operFax;
		this.operTel = operTel;
		this.roleName = roleName;
		this.role = role;
		this.operOrgName = operOrgName;
	}

	// Property accessors

	@Id
	@Column(name = "OPER_ID", unique = true, nullable = false, length = 8)
	public String getOperId() {
		return this.operId;
	}

	public void setOperId(String operId) {
		this.operId = operId;
	}

	@Column(name = "OPER_NAME", nullable = false, length = 40)
	public String getOperName() {
		return this.operName;
	}

	public void setOperName(String operName) {
		this.operName = operName;
	}

	@Column(name = "OPER_PASSWD", nullable = false, length = 32)
	public String getOperPasswd() {
		return this.operPasswd;
	}

	public void setOperPasswd(String operPasswd) {
		this.operPasswd = operPasswd;
	}

	@Column(name = "OPER_STATUS", nullable = false, length = 1)
	public String getOperStatus() {
		return this.operStatus;
	}

	public void setOperStatus(String operStatus) {
		this.operStatus = operStatus;
	}

	@Column(name = "OPER_FLAG", nullable = false, length = 1)
	public String getOperFlag() {
		return this.operFlag;
	}

	public void setOperFlag(String operFlag) {
		this.operFlag = operFlag;
	}

	@Column(name = "OPER_ORG_NO", nullable = false, length = 15)
	public String getOperOrgNo() {
		return this.operOrgNo;
	}

	public void setOperOrgNo(String operOrgNo) {
		this.operOrgNo = operOrgNo;
	}

	@Column(name = "OPER_UTIME", nullable = false, length = 14)
	public String getOperUtime() {
		return this.operUtime;
	}

	public void setOperUtime(String operUtime) {
		this.operUtime = operUtime;
	}

	@Column(name = "OPER_ITIME", nullable = false, length = 14)
	public String getOperItime() {
		return this.operItime;
	}

	public void setOperItime(String operItime) {
		this.operItime = operItime;
	}

	@Column(name = "OPER_EMAIL", length = 40)
	public String getOperEmail() {
		return this.operEmail;
	}

	public void setOperEmail(String operEmail) {
		this.operEmail = operEmail;
	}

	@Column(name = "OPER_FAX", length = 15)
	public String getOperFax() {
		return this.operFax;
	}

	public void setOperFax(String operFax) {
		this.operFax = operFax;
	}

	@Column(name = "OPER_TEL", length = 15)
	public String getOperTel() {
		return this.operTel;
	}

	public void setOperTel(String operTel) {
		this.operTel = operTel;
	}

	@Column(name = "ROLE_NAME", nullable = false, length = 40)
	public String getRoleName() {
		return this.roleName;
	}

	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}

	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name = "ROLE_ID", nullable = false)
	public Role getRole() {
		return this.role;
	}

	public void setRole(Role role) {
		this.role = role;
	}

	@Column(name = "OPER_ORG_NAME", nullable = false, length = 40)
	public String getOperOrgName() {
		return this.operOrgName;
	}

	public void setOperOrgName(String operOrgName) {
		this.operOrgName = operOrgName;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof UIOper))
			return false;
		UIOper castOther = (UIOper) other;

		return ((this.getOperId() == castOther.getOperId()) || (this
				.getOperId() != null && castOther.getOperId() != null && this
				.getOperId().equals(castOther.getOperId())))
				&& ((this.getOperName() == castOther.getOperName()) || (this
						.getOperName() != null
						&& castOther.getOperName() != null && this
						.getOperName().equals(castOther.getOperName())))
				&& ((this.getOperPasswd() == castOther.getOperPasswd()) || (this
						.getOperPasswd() != null
						&& castOther.getOperPasswd() != null && this
						.getOperPasswd().equals(castOther.getOperPasswd())))
				&& ((this.getOperStatus() == castOther.getOperStatus()) || (this
						.getOperStatus() != null
						&& castOther.getOperStatus() != null && this
						.getOperStatus().equals(castOther.getOperStatus())))
				&& ((this.getOperFlag() == castOther.getOperFlag()) || (this
						.getOperFlag() != null
						&& castOther.getOperFlag() != null && this
						.getOperFlag().equals(castOther.getOperFlag())))
				&& ((this.getOperOrgNo() == castOther.getOperOrgNo()) || (this
						.getOperOrgNo() != null
						&& castOther.getOperOrgNo() != null && this
						.getOperOrgNo().equals(castOther.getOperOrgNo())))
				&& ((this.getOperUtime() == castOther.getOperUtime()) || (this
						.getOperUtime() != null
						&& castOther.getOperUtime() != null && this
						.getOperUtime().equals(castOther.getOperUtime())))
				&& ((this.getOperItime() == castOther.getOperItime()) || (this
						.getOperItime() != null
						&& castOther.getOperItime() != null && this
						.getOperItime().equals(castOther.getOperItime())))
				&& ((this.getOperEmail() == castOther.getOperEmail()) || (this
						.getOperEmail() != null
						&& castOther.getOperEmail() != null && this
						.getOperEmail().equals(castOther.getOperEmail())))
				&& ((this.getOperFax() == castOther.getOperFax()) || (this
						.getOperFax() != null && castOther.getOperFax() != null && this
						.getOperFax().equals(castOther.getOperFax())))
				&& ((this.getOperTel() == castOther.getOperTel()) || (this
						.getOperTel() != null && castOther.getOperTel() != null && this
						.getOperTel().equals(castOther.getOperTel())))
				&& ((this.getRoleName() == castOther.getRoleName()) || (this
						.getRoleName() != null
						&& castOther.getRoleName() != null && this
						.getRoleName().equals(castOther.getRoleName())))
				&& ((this.getRole() == castOther.getRole()) || (this
						.getRole() != null && castOther.getRole() != null && this
						.getRole().equals(castOther.getRole())))
				&& ((this.getOperOrgName() == castOther.getOperOrgName()) || (this
						.getOperOrgName() != null
						&& castOther.getOperOrgName() != null && this
						.getOperOrgName().equals(castOther.getOperOrgName())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getOperId() == null ? 0 : this.getOperId().hashCode());
		result = 37 * result
				+ (getOperName() == null ? 0 : this.getOperName().hashCode());
		result = 37
				* result
				+ (getOperPasswd() == null ? 0 : this.getOperPasswd()
						.hashCode());
		result = 37
				* result
				+ (getOperStatus() == null ? 0 : this.getOperStatus()
						.hashCode());
		result = 37 * result
				+ (getOperFlag() == null ? 0 : this.getOperFlag().hashCode());
		result = 37 * result
				+ (getOperOrgNo() == null ? 0 : this.getOperOrgNo().hashCode());
		result = 37 * result
				+ (getOperUtime() == null ? 0 : this.getOperUtime().hashCode());
		result = 37 * result
				+ (getOperItime() == null ? 0 : this.getOperItime().hashCode());
		result = 37 * result
				+ (getOperEmail() == null ? 0 : this.getOperEmail().hashCode());
		result = 37 * result
				+ (getOperFax() == null ? 0 : this.getOperFax().hashCode());
		result = 37 * result
				+ (getOperTel() == null ? 0 : this.getOperTel().hashCode());
		result = 37 * result
				+ (getRoleName() == null ? 0 : this.getRoleName().hashCode());
		result = 37 * result
				+ (getRole() == null ? 0 : this.getRole().hashCode());
		result = 37
				* result
				+ (getOperOrgName() == null ? 0 : this.getOperOrgName()
						.hashCode());
		return result;
	}

}